home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 23 / AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso / PublicDomain / Anwendungen / ImageManager / Developer / libraries / ImageManager.h
C/C++ Source or Header  |  1999-11-10  |  5KB  |  235 lines

  1. #ifndef LIBRARIES_IMAGEMANAGER_H
  2. #define LIBRARIES_IMAGEMANAGER_H
  3. /*
  4. **    $VER: ImageManager.h 1.0 (11.10.99)
  5. */
  6.  
  7. #ifndef UTILITY_TAGITEM_H
  8. #include <utility/tagitem.h>
  9. #endif
  10.  
  11. enum
  12. {
  13.     IMV_ExtDecoder_Base        = TAG_USER +  0*256,
  14.     IMV_Base                        = TAG_USER +  1*256,
  15.     IMV_Container_Base        = TAG_USER +  2*256,
  16.     IMV_Decoder_Base            = TAG_USER +  3*256,
  17.     IMV_File_Base                = TAG_USER +  4*256,
  18.     IMV_FSDither_Base            = TAG_USER +  5*256,
  19.     IMV_OrderedDither_Base    = TAG_USER +  6*256,
  20.     IMV_Probe_Base                = TAG_USER +  7*256,
  21.     IMV_RandomDither_Base    = TAG_USER +  8*256,
  22.     IMV_Raster_Base            = TAG_USER +  9*256,
  23.     IMV_Remap_Base                = TAG_USER + 10*256,
  24.  
  25.     IMV_NumberOfBases
  26. };
  27.  
  28. enum
  29. {
  30.     IMA_Container_Screen = IMV_Container_Base,
  31.     IMA_Container_ColourCube,
  32.     IMA_Container_ReleaseColourCube,
  33.  
  34.     IMV_Container_NumberOf
  35. };
  36.  
  37. enum
  38. {
  39.     IMM_ExtDecoder_ReceiveData = IMV_ExtDecoder_Base,
  40.     IMM_ExtDecoder_NewFrame,
  41.     IMM_ExtDecoder_SendLine,
  42.     IMM_ExtDecoder_EndFrame,
  43.  
  44.     IMM_ExtDecoder_Error,
  45.     IMM_ExtDecoder_Warning,
  46.  
  47.     IMA_ExtDecoder_Gamma,                /* ULONG, gamma correction value */
  48.     IMA_ExtDecoder_BGColour,            /* 0x00RRGGBB - for PNG */
  49.  
  50.     IMA_ExtDecoder_ReducedProgressiveness,
  51.  
  52.     IMV_ExtDecoder_NumberOf
  53. };
  54.  
  55. enum
  56. {
  57.     IMM_NewFrame = IMV_Base,
  58.     IMM_ReceiveData,
  59.     IMM_EndFrame,
  60.     IMM_Abort,
  61.  
  62.     IMA_Next,
  63.  
  64.     IMV_NumberOf
  65. };
  66.  
  67. enum
  68. {
  69.     IMM_FSDither_CacheLine = IMV_FSDither_Base,
  70.     IMM_FSDither_FreeCacheLine,
  71.     IMM_FSDither_NewErrorLine,
  72.     IMM_FSDither_FreeErrorLine,
  73.  
  74.     IMA_FSDither_ColourCube,
  75.  
  76.     IMV_FSDither_NumberOf
  77. };
  78.  
  79. enum
  80. {
  81.     IMA_Remap_ColourCube = IMV_Remap_Base,
  82.  
  83.     IMV_Remap_NumberOf
  84. };
  85.  
  86. enum
  87. {
  88.     IMA_Probe_NewFrameHook = IMV_Probe_Base,
  89.     IMA_Probe_ReceiveDataHook,
  90.     IMA_Probe_EndFrameHook,
  91.  
  92.     IMA_Probe_NunberOf
  93. };
  94.  
  95. enum
  96. {
  97.     IMA_Raster_RastPort = IMV_Raster_Base,
  98.     IMA_Raster_OffsetX,
  99.     IMA_Raster_OffsetY,
  100.  
  101.     IMV_Raster_NumberOf
  102. };
  103.  
  104. enum
  105. {
  106.     IMM_File_Load = IMV_File_Base,
  107.  
  108.     IMA_File_BufferSize,
  109.  
  110.     IMV_File_NumberOf
  111. };
  112.  
  113. /* IMM_Error & IMM_Warning */
  114. struct IMP_ExtDecoder_Message
  115. {
  116.     ULONG MethodID;
  117.     STRPTR String;
  118.     APTR Parms;
  119. };
  120.  
  121. /* You're sent data with this method. */
  122. struct IMP_ExtDecoder_ReceiveData
  123. {
  124.     ULONG MethodID;
  125.     UBYTE *Buffer;
  126.     ULONG Length;
  127.     ULONG Flags;
  128. };
  129.  
  130. /* When you know the dimensions of the image
  131.    (or frame for animations) then you invoke
  132.    this method on yourself. */
  133. struct IMP_ExtDecoder_NewFrame
  134. {
  135.     ULONG MethodID;
  136.     ULONG Width, Height;
  137.     struct TagItem Tags; /* see below for definitions */
  138. };
  139.  
  140. enum
  141. {
  142.     NFA_Transparency = TAG_USER, /* see below */
  143.     NFA_Background, /* background colour of image */
  144.  
  145.     /* Following tags are for animations */
  146.     NFA_ScrWidth,
  147.     NFA_ScrHeight,
  148.     NFA_LeftOfs,
  149.     NFA_TopOfs,
  150.     NFA_FrameDelay,
  151.     NFA_FrameDisposal,
  152.     NFA_LoopCount,
  153.  
  154.     NFA_NumberOf
  155. };
  156.  
  157. enum
  158. {
  159.     TransparencyNONE = 0, /* The image does not contain transparent colours */
  160.     TransparencySINGLE,     /* The image has a monochrome mask ( A = 0x00 | 0xFF ) */
  161.     TransparencyALPHA         /* The image has a complex mask ( 0x00 <= A <= 0xFF ) */
  162. };
  163.  
  164. enum
  165. {
  166.     ProgressiveOmitNone = 0,
  167.     ProgressiveOmitIntermediate,
  168.     ProgressiveOmitAll
  169. };
  170.  
  171.  
  172. /* Whenever you have a line to output, you call this method */
  173. struct IMP_ExtDecoder_SendLine
  174. {
  175.     ULONG MethodID;
  176.     ULONG *LineBuffer;    /* Line buffer in RGBA format */
  177.     ULONG Y, Height;        /* Position and height of line - Height > 1 e.g. for interlaced GIFs */
  178.     ULONG Flags;            /* See below */
  179. };
  180.  
  181. #define IMB_ExtDecoder_SendLine_Draft         0   /* This line is just a rough draft, a new one will be outputed later, at same position */
  182. #define IMB_ExtDecoder_SendLine_KeepIntact    1   /* The owner of the buffer will need the line for further operations so make a copy if you need to destroy it */
  183.  
  184. #define IMF_ExtDecoder_SendLine_Draft        (1 << IMB_SendLine_Draft)
  185. #define IMF_ExtDecoder_SendLine_KeepIntact   (1 << IMB_SendLine_KeepIntact)
  186.  
  187. /* When the entire frame has been passed on then you invoke this method */
  188. struct IMP_ExtDecoder_EndFrame
  189. {
  190.     ULONG MethodID;
  191. };
  192.  
  193. struct IMP_NewFrame            { ULONG MethodID; ULONG Width, Height; struct TagItem *Tags; };
  194. struct IMP_EndFrame            { ULONG MethodID; };
  195. struct IMP_Abort                { ULONG MethodID; };
  196.  
  197. struct IMP_ReceiveData
  198. {
  199.     ULONG MethodID;
  200.     ULONG Type;
  201.     union
  202.     {
  203.         struct
  204.         {
  205.             UBYTE *Data;
  206.             ULONG Length;
  207.             ULONG Flags;
  208.         } Raw;
  209.  
  210.         struct
  211.         {
  212.             ULONG *RGBA, Width;
  213.             ULONG Y, Height, Flags;
  214.             UBYTE *Chunky;
  215.         } Pixels;
  216.     };
  217. };
  218.  
  219. enum
  220. {
  221.     IMV_ReceiveData_Type_Raw,
  222.     IMV_ReceiveData_Type_Pixels
  223. };
  224.  
  225. #define IMF_ReceiveData_Draft        (1 << 0)
  226. #define IMF_ReceiveData_KeepIntact   (1 << 1)
  227.  
  228. struct IMP_File_Load
  229. {
  230.     ULONG MethodID;
  231.     STRPTR Filename;
  232. };
  233.  
  234. #endif
  235.